package cn.iocoder.yudao.module.biz.dal.mysql.risk.equipmentInfo;

import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.biz.controller.admin.risk.basicManage.vo.BizBasicManageRespVO;
import cn.iocoder.yudao.module.biz.controller.admin.risk.equipmentInfo.vo.BizEquipmentInfoExcelVO;
import cn.iocoder.yudao.module.biz.controller.admin.risk.equipmentInfo.vo.BizEquipmentInfoExportReqVO;
import cn.iocoder.yudao.module.biz.controller.admin.risk.equipmentInfo.vo.BizEquipmentInfoPageReqVO;
import cn.iocoder.yudao.module.biz.controller.admin.risk.equipmentInfo.vo.BizEquipmentInfoRespVO;
import cn.iocoder.yudao.module.biz.dal.dataobject.risk.equipmentInfo.BizEquipmentInfoDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 设备 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface BizEquipmentInfoMapper extends BaseMapperX<BizEquipmentInfoDO> {

    default PageResult<BizEquipmentInfoDO> selectPage(BizEquipmentInfoPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BizEquipmentInfoDO>()
                .likeIfPresent(BizEquipmentInfoDO::getEquipmentName, reqVO.getEquipmentName())
                .eqIfPresent(BizEquipmentInfoDO::getDeptId,reqVO.getDeptId())
                .orderByDesc(BizEquipmentInfoDO::getId));
    }

    default List<BizEquipmentInfoDO> selectList(BizEquipmentInfoExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<BizEquipmentInfoDO>()
                .likeIfPresent(BizEquipmentInfoDO::getEquipmentName, reqVO.getEquipmentName())
                .eqIfPresent(BizEquipmentInfoDO::getDeptId,reqVO.getDeptId())
                .orderByDesc(BizEquipmentInfoDO::getId));
    }

    List<Map<String,Object>> getEquipmentPie(BizEquipmentInfoDO equipmentInfoDO);

    List<BizEquipmentInfoRespVO> getEquipmentPage(BizEquipmentInfoPageReqVO reqVO);

    Integer getEquipmentInfoCount(BizEquipmentInfoPageReqVO reqVO);

    List<BizEquipmentInfoExcelVO> getEquipmentInfoForExport(BizEquipmentInfoExportReqVO exportReqVO);
}
